package net.hn.hnms.biz.energy.company.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.energy.company.service.EnergyCompanyService;
import net.hn.hnms.biz.energy.request.*;
import net.hn.hnms.biz.energy.vo.*;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.core.web.controller.BaseController;
import net.hn.hnms.biz.energy.request.*;
import net.hn.hnms.biz.energy.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "能耗管理公司端接口", tags = {"能耗管理公司端接口"})
@RestController
@RequestMapping("/company/energy")
public class EnergyCompanyController extends BaseController {

    @Autowired
    private EnergyCompanyService energyCompanyService;

    @ApiOperation(value = "公司端供水单位查询")
    @RequestMapping(value = "/selectWaterSupplyByCompanyCodeOrMineCodeOrMineName", method = RequestMethod.GET)
    public R<List<WaterSupplyCompanyVo>> selectWaterSupplyByCompanyCodeOrMineCodeOrMineName(WaterSupplyCompanyReq param) {
        return R.ok(energyCompanyService.getWaterSupplyCompanyByMineCode(param));
    }

    @ApiOperation(value = "公司端用水单价查询")
    @RequestMapping(value = "/selectWaterPlacePriceByCompanyCodeOrMineCodeOrMineName", method = RequestMethod.GET)
    public R<List<WaterPlacePriceVo>> selectWaterPlacePriceByCompanyCodeOrMineCodeOrMineName(WaterPlacePriceReq param) {
        return R.ok(energyCompanyService.getWaterPlacePriceCompanyByMineCode(param));
    }

    @ApiOperation(value = "公司端用水结算查询")
    @RequestMapping(value = "/selectWaterSettlementByCompanyCodeOrMineCodeOrMineName", method = RequestMethod.GET)
    public R<List<WaterSettlementVo>> selectWaterSettlementByCompanyCodeOrMineCodeOrMineName(WaterSettlementReq param) {
        return R.ok(energyCompanyService.getWaterSettlementCompanyByMineCode(param));
    }


    @ApiOperation(value = "公司端供水台账查询")
    @RequestMapping(value = "/selectWaterRecordByCompanyCodeOrMineCodeOrMineName", method = RequestMethod.GET)
    public R<List<WaterRecordVo>> selectWaterRecordByCompanyCodeOrMineCodeOrMineName(WaterRecordReq param) {
        return R.ok(energyCompanyService.getWaterRecordByMineCode(param));
    }

    @ApiOperation(value = "公司端电负荷单价查询")
    @RequestMapping(value = "/selectElectricityPlacePriceByCompanyCodeOrMineCodeOrMineName", method = RequestMethod.GET)
    public R<List<ElectricityPlacePriceVo>> selectElectricityPlacePriceByCompanyCodeOrMineCodeOrMineName(ElectricityPlacePriceReq param) {
        return R.ok(energyCompanyService.getElectricityPlacePriceByMineCode(param));
    }

    @ApiOperation(value = "公司端用电查询")
    @RequestMapping(value = "/selectElectricitySettlementByCompanyCodeOrMineCodeOrMineName", method = RequestMethod.GET)
    public R<List<ElectricitySettlementVo>> selectElectricitySettlementByCompanyCodeOrMineCodeOrMineName(ElectricitySettlementReq param) {
        return R.ok(energyCompanyService.getElectricitySettlementVoByMineCode(param));
    }


    @ApiOperation(value = "公司端用电分析")
    @RequestMapping(value = "/selectPowerStatisticsInfoByCompanyCodeOrMineCodeOrMineName", method = RequestMethod.GET)
    public R<List<PowerStatisticsInfoVo>> selectPowerStatisticsInfoByCompanyCodeOrMineCodeOrMineName(PowerStatisticsInfoReq param) {
        return R.ok(energyCompanyService.getElectricitySettlementVoByMineCode(param));
    }

    @ApiOperation("经营综合概览-水电能耗合计公司端")
    @GetMapping("/getWaterStatisticsByCompanyCodeOrMineCodeOrName")
    public R<HydropowerVo> getWaterStatisticsByCompanyCodeOrMineCodeOrName(String companyCode, String mineCode) {
        return R.ok(energyCompanyService.getWaterStatisticsByCompanyCodeOrMineCodeOrName(companyCode,mineCode));
    }




}
